﻿using Sw.Hospital.HealthExaminationSystem.ApiProxy.CusReg;
using Sw.Hospital.HealthExaminationSystem.Application.CusReg;
using Sw.Hospital.HealthExaminationSystem.Application.CusReg.Dto;
using Sw.Hospital.HealthExaminationSystem.Common.Bases;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Sw.Hospital.HealthExaminationSystem.CusReg
{
    public partial class frmRYXX : UserBaseForm
    {
        private string strName = "";
        private ICustomerAppService customerSvr;//体检预约
        public QueryCustomerDto cusinfo=new QueryCustomerDto();
        public frmRYXX()
        {
            InitializeComponent();
        }
        public frmRYXX(string _searchName):this()
        {
            strName = _searchName;
        }

        private void frmjs_Load(object sender, EventArgs e)
        {
            customerSvr = new CustomerAppService();
        }

        private void frmRYXX_Shown(object sender, EventArgs e)
        {
            SearchCustomerDto input = new SearchCustomerDto();
            input.Name = strName;
            var cuslist = customerSvr.getCusInfo(input);
            gridControl1.DataSource = cuslist;
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            var data = gridView1.GetFocusedRow() as QueryCustomerDto;
            if (data != null)
            {
                cusinfo = data;
                this.DialogResult = DialogResult.OK;
            }
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
